//
//  CellTwoTab.m
//  project-A (pianke)
//
//  Created by dllo on 16/1/27.
//  Copyright © 2016年 scott. All rights reserved.
//

#import "CellTwoTab.h"
#import <DKNightVersion.h>
@implementation CellTwoTab

-(void)dealloc{
    
    [_title release];
    [_time release];
    [_desc release];
    [_image release];
    [_xianview release];
    [super dealloc];
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatview];
        
        
    }
    
    return self;
}

-(void)creatview{
    self.title = [[UILabel alloc]init];
    [self.contentView addSubview:self.title];
   
     self.title.dk_textColorPicker = DKColorWithColors([UIColor blackColor], [UIColor whiteColor]);
    
   self.title.font = [UIFont fontWithName:@"AmericanTypewriter-Bold" size:20];
    
    
    [self.title release];
    
    self.desc  = [[UILabel alloc]init];
    [self.contentView addSubview:self.desc];
    self.desc.numberOfLines = 2;
    
     self.desc.dk_textColorPicker = DKColorWithColors([UIColor blackColor], [UIColor whiteColor]);
    
    self.desc.font = [UIFont systemFontOfSize:14];
 
    
    [self.desc release];
    
    self.image = [[UIImageView alloc]init];
    [self.contentView addSubview:self.image];
    self.image.image = [UIImage imageNamed:@"hot2"];
    self.image.hidden = YES;
    [self.image release];
    
    self.time = [[UILabel alloc]init];
    [self.contentView addSubview:self.time];
    
    self.time.font = [UIFont systemFontOfSize:10];
     self.time.dk_textColorPicker = DKColorWithColors([UIColor blackColor], [UIColor whiteColor]);
    [self.time release];
    
    
    
    self.xianview  = [[UIView alloc]init];
    [self.contentView addSubview:self.xianview];
    self.xianview.backgroundColor = [UIColor lightGrayColor];
        [self.xianview release];
}
 
-(void)layoutSubviews{
    [super layoutSubviews];
    CGFloat width = self.contentView.frame.size.width;
    
    self.title.frame = CGRectMake(15, 20, 0.9 * width, 30);
    self.desc.frame = CGRectMake(15, 70, width - 30, 40);
    self.image.frame = CGRectMake(width - 45, 20, 35, 25);
    
    self.time.frame = CGRectMake(0.81 *width, 0.25 *width, 0.15 *width, 15);
    
    self.xianview.frame = CGRectMake(15, 0.225 * width +29, width - 30, 1);
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
